package com.wisely.highlight_spring4.ch2.event;

import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

/**
 * @ClassName DemoListener
 * @Description TODO
 * @Author Mike
 * @Date 2018/11/25 17:53
 * @Version 1.0
 */
@Component
public class DemoListener implements ApplicationListener<DemoEvent> {

    public void onApplicationEvent(DemoEvent event) {
        String msg = event.getMsg();

        System.out.println("我（bean-demoListener) 接收到了 bean-demoPublisher 发布的消息：" + msg);
    }
}
